package cn.easier.activity.console.service;

import cn.easier.activity.console.utils.DelayMessage;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.DelayQueue;

public interface MessagePostQueueService {

    BlockingQueue<DelayMessage> DELAY_QUEUE = new DelayQueue<>();

    String SERIALIZE_FILE_NAME = "SerializeMessagePostParams.json";

    /**
     * 用于初始化队列，并无限等待新任务
     */
    void queue();

    /**
     * 向队列中添加新的任务，同时更新本地备份数据
     */
    boolean offer(DelayMessage delayMessage);
}
